import React from 'react';

import {menu} from './styles'
import MenuItem from './menus/MenuItem'

const Menus = [
    {
        name: '用户信息',
        path: '/users'
    },
    {
        name: '数据管理',
        path: '/datas',
        subMenus: [
            {
                name: '总体概览',
                path: '/total'
            },
            {
                name: '用户分析',
                path: '/user'
            },
            {
                name: '订单分析',
                path: '/order'
            }
        ]
    }
];

class Menu extends React.Component {

    render() {
        return <div style={menu}>
            <ul>
                {
                    Menus.map(function (menu, index) {
                        return <MenuItem key={index} menu={menu}/>
                    })
                }
            </ul>
        </div>
    }
}

export default Menu;
